package com.my.concurrency.timer;

import lombok.extern.slf4j.Slf4j;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Timer 测试
 *
 * @author: marshal
 * @date: 2023-07-21 4:52 PM
 */
@Slf4j
public class TimerTest {

    private static final Long DELAY = 10 * 1000L;


    public static void main(String[] args) {
        test();
    }

    private static void test() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                log.debug("this is after {} seconds", DELAY / 1000);
            }
        }, DELAY);
    }

}
